import io
from abc import ABCMeta,abstractmethod


class InterfaceThread(metaclass=ABCMeta):
    @abstractmethod
    def whileBody(self, count):
        """
        线程的循环体
        :return:
        """
        ...

    def whileBreak(self, _io):
        """
        停止线程
        :return:
        """

        print("====================停止线程===================")
        _io.close()
        _io = io.BytesIO(b"break")
        return _io
